{extend name="common/common" /}

{block name="content"}
<el-row>
	<el-col :md="12">
		<div class="ibox-title">
		    <h5>选择报表日期</h5>
		</div>
		<div class="ibox-content">
			<el-form label-width="120px">
				<el-form-item label="选择报表日期">
					<el-date-picker
						v-model="rpt_date"
						type="month" value-format="yyyy-MM"
						placeholder="选择报表日期">
				    </el-date-picker>
				</el-form-item>
				<el-form-item label=" ">
					<el-button type="primary" @click="write" plain>上报</el-button>
				</el-form-item>
			</el-form>
		</div>
	</el-col>
</el-row>
{/block}

{block name="script"}
<script type="text/javascript">
var main =  new Vue({
	el:"#main",
	data:{
		loading:false,
		rpt_date:"",
	},
	methods:{
		write() {
			if(this.rpt_date == ''){
				this.$notify.error({title:"错误",message:"请选择上报日期"});
			}else{
				$.post("{:url('Icdata/Commit_all_county')}",{rpt_date:this.rpt_date},function(res) {
					if(res.code == 1){
						window.location.href = "{:url('Icdata/writeTable_all_county')}?rpt_date="+main.rpt_date;
					}else{
						main.$notify.error({title:"错误",message:res.msg});
					}
				});
			}
		}
	}
})
</script>
{/block}
